import { post } from "../utlis/http.js"
export const scheduling = {
    //添加工单
    addWorkOrder(param,type){
        if(type == "新增"){
            return post(`/workOrder/add`,param)
        }else{
            return post(`/workOrder/modify`,param) //修改
        }
    },
    //查询列表
    workOrderList(param){
        if(param.field){
            return post(`/workOrder/list?page=${param.page}&size=${param.size}&sort=${param.field},${param.order}`,param)
        }else{
            return post(`/workOrder/list?page=${param.page}&size=${param.size}`,param)
        }
        
    },
    //获取配方列表
    getTbrecipeList(param){
        if(param.field){
            return post(`/tbrecipe/list?page=${param.page}&size=${param.size}&sort=${param.field},${param.order}`,param)
        }else{
            return post(`/tbrecipe/list?page=${param.page}&size=${param.size}`,param)
        }
        
    },
    //删除工单
    removeWorkOrder(id){
        return post(`/workOrder/remove`,{woId:id})
    },
    //修改工单状态
    modifyStatus(param){
        return post(`/workOrder/modifyStatus`,param)
    },
    //校验工单是否重复
    workOrderCheck(param){
        return post(`/workOrder/check`,param)
    },
    //验证批次号是否重复
    checkLot(param){
        return post(`/workOrder/checkLot`,param)
    }
}

